package com.blockmeta.bbs.immodule.net.pojo;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;

/**
 * @author AirThor
 * @date 2019/3/25.
 * 创建圈子成功后返回的数据
 */
public class CircleDetailResponse implements Parcelable {

    /**
     * account : 100014
     * auth_rule : 1
     * big_class_id : 4
     * create_by_id : 251483
     * create_date : 1553503027
     * description :
     * group_level : 0
     * group_logo :
     * id : 15
     * manager1_id : 0
     * manager2_id : 0
     * name : 哇哈哈呀
     * qrcode :
     * slogan :
     * small_class_id : 0
     * user_level : 0
     */

    @SerializedName("account")
    public String account;
    @SerializedName("auth_rule")
    public int authRule;
    @SerializedName("big_class_id")
    public int bigClassId;
    @SerializedName("create_by_id")
    public int createById;
    @SerializedName("create_date")
    public int createDate;
    @SerializedName("description")
    public String description;
    @SerializedName("group_level")
    public int groupLevel;
    @SerializedName("group_logo")
    public String groupLogo;
    @SerializedName("id")
    public int id;
    @SerializedName("manager1_id")
    public int manager1Id;
    @SerializedName("manager2_id")
    public int manager2Id;
    @SerializedName("name")
    public String name;
    @SerializedName("qrcode")
    public String qrcode;
    @SerializedName("slogan")
    public String slogan;
    @SerializedName("small_class_id")
    public int smallClassId;
    @SerializedName("user_level")
    public int userLevel;
    @SerializedName("shield")
    public boolean isShield;
    @SerializedName("me_in")
    public boolean isMeIn;
    @SerializedName("no_disturbing")
    public boolean noDisturbing;
    /** 0表示未认证 1表示认证*/
    @SerializedName("identification")
    public int identification;
    @SerializedName("owner_last_msg_time")
    public long ownerLastMsgTime;


    protected CircleDetailResponse(Parcel in) {
        account = in.readString();
        authRule = in.readInt();
        bigClassId = in.readInt();
        createById = in.readInt();
        createDate = in.readInt();
        description = in.readString();
        groupLevel = in.readInt();
        groupLogo = in.readString();
        id = in.readInt();
        manager1Id = in.readInt();
        manager2Id = in.readInt();
        name = in.readString();
        qrcode = in.readString();
        slogan = in.readString();
        smallClassId = in.readInt();
        userLevel = in.readInt();
        isShield = in.readByte() != 0;
        isMeIn = in.readByte() != 0;
        noDisturbing = in.readByte() != 0;
        identification = in.readInt();
        ownerLastMsgTime = in.readLong();
    }

    public static final Creator<CircleDetailResponse> CREATOR = new Creator<CircleDetailResponse>() {
        @Override
        public CircleDetailResponse createFromParcel(Parcel in) {
            return new CircleDetailResponse(in);
        }

        @Override
        public CircleDetailResponse[] newArray(int size) {
            return new CircleDetailResponse[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(account);
        dest.writeInt(authRule);
        dest.writeInt(bigClassId);
        dest.writeInt(createById);
        dest.writeInt(createDate);
        dest.writeString(description);
        dest.writeInt(groupLevel);
        dest.writeString(groupLogo);
        dest.writeInt(id);
        dest.writeInt(manager1Id);
        dest.writeInt(manager2Id);
        dest.writeString(name);
        dest.writeString(qrcode);
        dest.writeString(slogan);
        dest.writeInt(smallClassId);
        dest.writeInt(userLevel);
        dest.writeByte((byte) (isShield ? 1 : 0));
        dest.writeByte((byte) (isMeIn ? 1 : 0));
        dest.writeByte((byte) (noDisturbing ? 1 : 0));
        dest.writeInt(identification);
        dest.writeLong(ownerLastMsgTime);
    }
}
